
package com.jims.master.modules.doctor.dao;

import com.jims.master.common.persistence.CrudDao;
import com.jims.master.common.persistence.annotation.MyBatisDao;
import com.jims.master.modules.doctor.entity.PrescriptionItem;
import com.jims.master.modules.doctor.vo.PrescDrugVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 门诊处方明细DAO接口
 * @author CTQ
 * @version 2017-03-13
 */
@MyBatisDao
public interface PrescriptionItemDao extends CrudDao<PrescriptionItem> {
    /**
     * 根据参数查询
     * @param q
     * @param limit
     * @param drugClass
     * @return
     * @author CTQ
     */
    public List<PrescDrugVo> findListByParam(@Param("q") String q, @Param("limit") String limit, @Param("drugClass") String drugClass, @Param("storageId")String storageId, @Param("orgId") String orgId);
    /**
     * 根据处方主表id查询处方明细
     * @param prescriptionItem
     * @return
     * @author CTQ
     */
    public List<PrescriptionItem> findListByApplyId(PrescriptionItem prescriptionItem);
    /**
     * 根据处方主表id删除处方明细
     * @param applyId
     * @return
     * @author CTQ
     */
    public int delByApplyId(@Param("applyId") String applyId);

    /**
     * 根据处方主表id查询处方明细
     * @param prescriptionItem
     * @return
     * @author ZhuQ
     */
    public List<PrescriptionItem> findByApplyId(PrescriptionItem prescriptionItem);

    /**
     * 通过 appId 查询子表数据
     * @param prescriptionItem
     * @return
     */
    public List<PrescriptionItem> getPreItem(PrescriptionItem prescriptionItem );

    public List<PrescriptionItem> selectHistory(@Param("applyId")String applyId);

    public PrescriptionItem findByPriceId(PrescriptionItem prescriptionItem);
}